#ifndef WAVE_H
#define WAVE_H
#include"stddef.h"

typedef struct Wave_Entry_struct {
	int index;
	int length;
} WaveEntry;

typedef struct wave_struct
{
	int samplerates;
	int nSamples;
	int nChannels;
	int sizeEncoded;
	WaveEntry **entries;
	short nWaves;
	short lenWave;
	BOOL encoded;
	short bps;
	BYTE *samples;
} Wave;

Wave* wave_load(const char* filename);
int wave_save(const char* filename, Wave *w);
void wave_free(Wave *w);
Wave* wave_load_huff(const char* filename);
int wave_save_huff(const char* filename, Wave *w);
Wave* wave_load_leasthuff(const char* filename);
int wave_save_leasthuff(const char* filename, Wave *w);
Wave* wave_synth(Wave* w1, float pfw1, float pew1, Wave* w2, float pfw2, float pew2);
Wave* wave_encode_huffman(Wave* w, BOOL isDiff);
Wave* wave_decode_huffman(Wave* w, BOOL isDiff);

#endif